// new Vue({
// 	el:'#searchIfo',
// 	data:{
// 			stu : [{
// 				name: '江英范1',
// 				candidateNumber: 20577995033748,
// 				academy: '信息科学与工程学院',
// 				class: '计算机类',
// 				major: '计算机科学与技术',
// 				more: '····'
// 			},{
// 				name: '江英范2',
// 				candidateNumber: 20577995033748,
// 				academy: '信息科学与工程学院',
// 				class: '计算机类',
// 				major: '计算机科学与技术',
// 				more: '····'
// 			},{
// 				name: '江英范3',
// 				candidateNumber: 20577995033748,
// 				academy: '信息科学与工程学院',
// 				class: '计算机类',
// 				major: '计算机科学与技术',
// 				more: '····'
// 			},{
// 				name: '江英范4',
// 				candidateNumber: 20577995033748,
// 				academy: '信息科学与工程学院',
// 				class: '计算机类',
// 				major: '计算机科学与技术',
// 				more: '····'
// 			},{
// 				name: '江英范5',
// 				candidateNumber: 20577995033748,
// 				academy: '信息科学与工程学院',
// 				class: '计算机类',
// 				major: '计算机科学与技术',
// 				more: '····'
// 			},{
// 				name: '江英范6',
// 				candidateNumber: 20577995033748,
// 				academy: '信息科学与工程学院',
// 				class: '计算机类',
// 				major: '计算机科学与技术',
// 				more: '····'
// 			},{
// 				name: '江英范7',
// 				candidateNumber: 20577995033748,
// 				academy: '信息科学与工程学院',
// 				class: '计算机类',
// 				major: '计算机科学与技术',
// 				more: '····'
// 			},{
// 				name: '江英范8',
// 				candidateNumber: 20577995033748,
// 				academy: '信息科学与工程学院',
// 				class: '计算机类',
// 				major: '计算机科学与技术',
// 				more: '····'
// 			},{
// 				name: '江英范9',
// 				candidateNumber: 20577995033748,
// 				academy: '信息科学与工程学院',
// 				class: '计算机类',
// 				major: '计算机科学与技术',
// 				more: '····'
// 			}]
// 		},
// 	methods:{
// 		 resetClick(){
// 			 document.getElementById('area').selectedIndex = 0;
// 			 document.getElementById('academy').selectedIndex = 0;
// 			 document.getElementById('class').selectedIndex = 0;
// 			 document.getElementById('sex').selectedIndex = 0;
// 			 document.getElementById('major').selectedIndex = 0;
// 			 document.getElementById('batch').selectedIndex = 0;
// 		 },
// 		 returnPage(){
// 			 window.location.replace("./teacQuery.html");
// 		 },

// 	},

// })
// function loadXMLDoc(){
// window.onload = function(){


var xhttp = new XMLHttpRequest();
// xhttp.open("post", "/teacher/getStudentFullsServlet?start=0&end=200", true);
// xhttp.send();

xhttp.onreadystatechange = function () {
    if (this.readyState == 4 && this.status == 200) {
        // console.log(this.responseText)
        text = JSON.parse(this.responseText).studentFulls
        // console.log(text.studentFulls[0])
        new Vue({
            el:'#searchIfo',
            data:{
                shield: false,
                header:[{
                    name: '姓名',
                    candidateNumber: '考生号',
                    academy: '学院',
                    class: '类别',
                    major: '专业',
                    more: '更多'
                }],
                text,
            },
            methods:{
                resetClick(){
                    document.getElementById('area').selectedIndex = 0;
                    document.getElementById('academy').selectedIndex = 0;
                    document.getElementById('class').selectedIndex = 0;
                    document.getElementById('sex').selectedIndex = 0;
                    document.getElementById('major').selectedIndex = 0;
                    document.getElementById('batch').selectedIndex = 0;
                },
                returnPage(){
                    window.location.replace("./teacQuery.html");
                },
                searchClick(){
                    let area = document.getElementById('area');				//地区
                    let academy = document.getElementById('academy');	//学院
                    let class1 = document.getElementById('class');			//类别
                    let sex = document.getElementById('sex');					//性别
                    let major = document.getElementById('major');			//专业
                    let batch = document.getElementById('batch');			//批次
                    let index1 = area.selectedIndex;
                    let index2 = academy.selectedIndex;
                    let index3 = class1.selectedIndex;
                    let index4 = sex.selectedIndex;
                    let index5 = major.selectedIndex;
                    let index6 = batch.selectedIndex;
                    let value1 = area.options[index1].text;
                    let value2 = academy.options[index2].text;
                    let value3 = class1.options[index3].text;
                    let value4 = sex.options[index4].text;
                    let value5 = major.options[index5].text;
                    let value6 = batch.options[index6].text;
                    console.log(value1);
                    console.log(value2);
                    console.log(value3);
                    console.log(value4);
                    console.log(value5);
                    console.log(value6);



                    // 				 console.log(this.text[0].sfbz);
                    // 				 let newText = null;
                    // 				 for( let i=0 ; i<200 ; i++){
                    // 					 console.log(this.text[i].sfbz);
                    // 					 if (!!this.text[i].sfbz == value1){
                    // 						 newText += this.text[i];
                    // //报错： Error in v-on handler: "TypeError: Cannot read properties of undefined (reading 'sfbz')"
                    // 						 // 也可能是后端返回给你的数据没有这个属性 或者 返回的有的有数据 有的是 null
                    // 					 }
                    // 				 }
                    // 				 console.log(newText);
                },
                seeMore(index){
                    // window.location.href = "./searchInformationMore.html"
                    // this.text.splice(index,1)
                    this.shield = true ;
                    const shieldDiv = document.getElementById('shield');
                    // let newText = this.text[index];
                    if (this.shield == true){
                        shieldDiv.innerHTML =`<table>`+
                            `<tr>`+
                            `<td>姓名</td>`+`<td>`+this.text[index].xm+`</td>`+
                            `</tr>`+
                            `<tr>`+
                            `<td>性别</td>`+`<td>`+this.text[index].xbmc+`</td>`+
                            `</tr>`+
                            `<tr>`+
                            `<td>考生号</td>`+`<td>`+this.text[index].ksh+`</td>`+
                            `</tr>`+
                            `<tr>`+
                            `<td>政治身份</td>`+`<td>`+this.text[index].zzmmmc+`</td>`+
                            `</tr>`+
                            `<tr>`+
                            `<td>民族</td>`+`<td>`+this.text[index].mzmc+`</td>`+
                            `</tr>`+
                            `<tr>`+
                            `<td>录取学院</td>`+`<td>`+this.text[index].fyxb+`</td>`+
                            `</tr>`+
                            `<tr>`+
                            `<td>录取专业</td>`+`<td>`+this.text[index].zymc+`</td>`+
                            `</tr>`+
                            `<tr>`+
                            `<td>省份</td>`+`<td>`+this.text[index].sfbz+`</td>`+
                            `</tr>`+
                            `<tr>`+
                            `<td>住址</td>`+`<td>`+this.text[index].sfbz+this.text[index].dqmc+this.text[index].jtdz+`</td>`+
                            `</tr>`+
                            `<tr>`+
                            `<td>录取批次</td>`+`<td>`+this.text[index].pcmc+`</td>`+
                            `</tr>`+
                            `<tr>`+
                            `<td>原高中</td>`+`<td>`+this.text[index].zxmc+`</td>`+
                            `</tr>`+
                            `</table>`


                    }


                    // alert(`姓名：`+this.text[index].xm+
                    // 			`\n性别：`+this.text[index].xbmc+
                    // 			`\n考生号：`+this.text[index].ksh+
                    // 			`\n政治身份：`+this.text[index].zzmmmc+
                    // 			`\n民族：`+this.text[index].mzmc+
                    // 			`\n录取学院：`+this.text[index].fyxb+
                    // 			`\n录取专业：`+this.text[index].zymc+
                    // 			`\n省份：`+this.text[index].sfbz+
                    // 			`\n住址：`+this.text[index].sfbz+this.text[index].dqmc+this.text[index].jtdz+
                    // 			`\n录取批次：`+this.text[index].pcmc+
                    // 			`\n原高中：`+this.text[index].zxmc)
                },
            },

        })
        jQuery(document).ready(function($){
            for (var i = 1; i <= 150; i++) {
                $('.list-group').append('<li class="list-group-item"> Item ' + i + '</li>');
            }

            $('.table tbody').paginathing({
                perPage: 10,
                insertAfter: '.table',
                pageNumbers: true
            });
        });

    }
};

// xhttp.open("post", "/teacher/getStudentFullsServlet?start=0&end=200&area=value1&gender=index4&academy=index2&major=index5&batch=index6&type=index3", true);

xhttp.open("post", "/teacher/GetStudentFullsServlet?start=0&end=200", true);

xhttp.send();

// setTimeout('loadXMLDoc()',1000);
// }
// }